using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration.Design;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration;

using EntLibContrib.PolicyInjection.Configuration;

namespace EntLibContrib.PolicyInjection.Design.Nodes
{
    /// <summary>
    /// A <see cref="ConfigurationNode"/> that represents the configuration
    /// of an <see cref="SynchronizedCallHandler" /> in the Configuration
    /// Console.
    /// </summary>
    public class SynchronizedCallHandlerNode : CallHandlerNode
    {
        /// <summary>
        /// Create a new <see cref="SynchronizedCallHandlerNode"/> with default settings.
        /// </summary>
        public SynchronizedCallHandlerNode()
            : this(new SynchronizedCallHandlerData(Resources.SynchronizedCallHandlerNodeName))
        {
        }

        /// <summary>
        /// Create a new <see cref="SynchronizedCallHandlerNode"/> with the given settings.
        /// </summary>
        /// <param name="callHandlerData">Configuration information to initialize the node with.</param>
        public SynchronizedCallHandlerNode(SynchronizedCallHandlerData callHandlerData)
            : base(callHandlerData)
        {
        }

        /// <summary>
        /// Converts the information stored in the node and generate
        /// the corresponding configuration element to store in
        /// an <see cref="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource" />.
        /// </summary>
        /// <returns>Newly created <see cref="SynchronizedCallHandlerData"/> containing
        /// the configuration data from this node.</returns>
        public override CallHandlerData CreateCallHandlerData()
        {
            SynchronizedCallHandlerData callHandlerData = new SynchronizedCallHandlerData(Name);

            return callHandlerData;
        }

    }
}
